﻿using Business.Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MyWindow_TaskBuildForOa : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ProcessRequest();
    }

    public void ProcessRequest()
    {
        Common.Encrypt enTemp = new Common.Encrypt();
        string strTempCode = DateTime.Now.ToString("yyyyMMdd");
        string strUserid = DesOperation.DESEnCode(HttpContext.Current.Session["RealUserId"].ToString(), strTempCode);

        string strRetUrl = "http://10.20.17.20/appportal.jsp?sysid=gongwenguanli";
        string strLoadUrl = DesOperation.DESEnCode(strRetUrl, strTempCode);
        //string strUrl = "http://10.20.17.30/PengingTaskServlet?method=loginAndSend&data={\"userId\":\"" + strUserid + "\",\"loadUrl\":\"" + strLoadUrl + "\"}";

        string strUrl = "http://10.20.17.30/jsp/ext/common/loginAndSend.jsp?userId="+strUserid+"&loadUrl=" + strLoadUrl;
        //Common.Log.LogManage.addLogErr(strUrl, strRetUrl);
        try
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.Method = "GET";
            request.ContentType = "text/xml";
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream resStream = response.GetResponseStream();
            StreamReader readStream = new StreamReader(resStream);
            string strGetData = readStream.ReadToEnd();
            Response.Redirect(strRetUrl);
            //if (!string.IsNullOrEmpty(strGetData))
            //{
            //    Response.Write(strGetData);
            //}
            //else
            //{
            //    Response.Redirect(strRetUrl);
            //}
            //Common.Log.LogManage.addLogErr(strUrl, strGetData);
        }
        catch (Exception ex)
        {
            Common.Log.LogManage.addLogErr(strUrl, ex.Message);
        }
    }
 
}